package com.twetec.cms.service.ucenter;

import com.baomidou.mybatisplus.extension.service.IService;
import com.twetec.cms.model.po.user.UserPO;
import com.twetec.cms.model.vo.ucenter.UserVO;
import com.xxg.base.module.Operater;
import com.xxg.base.module.PageData;

import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author zhxl
 * @since 2020-10-12
 */
public interface UserService extends IService<UserPO> {

    /**
     * 添加权限菜单到redis中
     * @param userId
     * @return
     */
    void addPermissionMenuListInRedis(Long userId);

    /**
     * 获取用户的权限菜单列表
     * @param userId
     * @return
     */
    List<Object> getPermissionMenuListFromRedis(Long userId);

    /**
     * 创建
     */
    boolean create(String unionMemberId, String name, String avatar, String credentialType, String credentialNumber, String telephone, String status, Date birthDate, String gender, String unit, String unions, String dataOrg);

    /**
     * 根据id获取
     */
    UserVO getByUserId(Long id);

    /**
     * 根据工会会员id更新
     */
    boolean updateById(String unionMemberId, String name, String avatar, String credentialType, String credentialNumber, String telephone, String status, Date birthDate, String gender, String unit, String unions, String dataOrg);

    /**
     * 删除
     */
    boolean removeById(Long id);

    /**
     * 根据工会会员id获取
     */
    UserVO getByUnionMemberId(String unionMemberId);

    /**
     * 根据工会会员ids获取用户ids
     */
    String getUserIdsByUnionMemberIds(String unionMemberIds);

    /**
     * 根据创建人名称, 模糊搜索用户ids
     */
    List<Long> getUserIdsByCreatorName(String creatorName);


    UserVO getUser(Operater operater, String unionMemberIds) throws ParseException;
}
